package org.appbase.web.controller;

import org.appbase.core.model.security.User;
import org.appbase.core.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * Created by Pablito on 21/01/14.
 */
@Controller
@RequestMapping(value = "/administracion")
public class AdminController {

    @Autowired
    protected UserService userService;

    @RequestMapping(value="/usuarios", method = RequestMethod.GET)
    public String listUsers(ModelMap model) {
        model.put("users", userService.getUserPage(2, 20));

        return "/secure/admin/users";
    }
}
